]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Simplify group change emission at KeyboardController
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 26 Jan 2024 19:22:14 +0000 (20:22 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 29 Feb 2024 15:34:21 +0000 (16:34 +0100)
Since we now just store the current group, we do not need to track
closely source changes vs selection changes in the available sources.
We just re-generate the current OSK keymap for all, so coalesce both
signals into a more generic "group-changed".

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>

js/ui/keyboard.js

index 423aeef23a45ac2afd902d3126476d5a71cc26f3..c7f244b02413f224ae3d9b1c134bfd26d04c05e6 100644 (file)
@@ -1335,8 +1335,7 @@ export const Keyboard = GObject.registerClass({
         this._updateKeys();
 
         this._keyboardController.connectObject(
-            'active-group', this._onGroupChanged.bind(this),
-            'groups-changed', this._onKeyboardGroupsChanged.bind(this),
+            'group-changed', this._onGroupChanged.bind(this),
             'panel-state', this._onKeyboardStateChanged.bind(this),
             'purpose-changed', this._onPurposeChanged.bind(this),
             this);
@@ -1755,10 +1754,6 @@ export const Keyboard = GObject.registerClass({
         this._updateKeys();
     }
 
-    _onKeyboardGroupsChanged() {
-        this._onGroupChanged();
-    }
-
     _onKeyboardStateChanged(controller, state) {
         let enabled;
         if (state === Clutter.InputPanelState.OFF)
@@ -2101,13 +2096,13 @@ class KeyboardController extends Signals.EventEmitter {
     }
 
     _onSourcesModified() {
-        this.emit('groups-changed');
+        this.emit('group-changed');
     }
 
     _onSourceChanged(inputSourceManager, _oldSource) {
         let source = inputSourceManager.currentSource;
         this._currentSource = source;
-        this.emit('active-group', source.id);
+        this.emit('group-changed');
     }
 
     _onContentPurposeHintsChanged(method) {